package mundo.java.client;

import mundo.java.client.events.StartupEvent;
import mundo.java.client.messages.GreetingMessages;
import mundo.java.client.messages.ServerMessages;
import mundo.java.client.view.ArtigoDialogView;
import mundo.java.client.view.ListMessagesView;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.inject.client.GinModules;
import com.google.gwt.inject.client.Ginjector;
import com.google.inject.Inject;

public class Artigo implements EntryPoint {
	@GinModules({ArtigoModule.class})
	interface Injector extends Ginjector { 
		DialogAppInitializer initDialog();
		// AlertAppInitializer initAlert();
	}
	Injector injector = GWT.create(Injector.class);

	public static class DialogAppInitializer {
		@Inject
		public DialogAppInitializer(HandlerManager eventBus, 
				ArtigoDialogView dialogView, ListMessagesView listView,
				ArtigoPresenter sendMessagePresenter, MessagesPresenter listMessagesPresenter) { 
			eventBus.fireEvent(new StartupEvent());
		}
	}

	public static interface Messages extends GreetingMessages, ServerMessages {  } 

	public void onModuleLoad() {
		injector.initDialog();
		// injector.initAlert();
	}
	
	/*
	public static class AlertAppInitializer {
		@Inject
		public AlertAppInitializer(HandlerManager eventBus, 
				ArtigoAlertView alertView, ListMessagesView listView,
				ArtigoPresenter sendMessagePresenter, MessagesPresenter listMessagesPresenter) { 
			eventBus.fireEvent(new StartupEvent());
		}
	}
	 */
}